<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="description" content="<<<.Description>>>">
    <meta name="keywords" content="<<<.KeyWords>>>">

    <meta name="format-detection" content="telephone=no">
    <title><<<.Configs.SiteTitle>>></title>
    <link rel="stylesheet" href="/static/blog/layui/css/layui.css">
    <link rel="stylesheet" href="/static/blog/css/common.css">
    <<< .HtmlHead >>>
</head>
<body style="background: #f1f1f1">
<header>
    <nav class="layui-container">
        <div class="layui-row">
            <div class="layui-col-md2 layui-col-sm2 layui-hide-xs logo">
                <a href="javascript:;"><img src="<<< .Configs.LogoImages >>>"></a>
            </div>
            <div class="layui-col-md8 layui-col-xs8 layui-col-sm8">
                <ul class="layui-nav" style="background-color: #2b2b2b">
                    <li class="layui-nav-item layui-this">
                        <a href="/">博客首页</a>
                    </li>
                </ul>
            </div>
            <<< if .User >>>
            <div class="layui-col-md2 layui-hide-xs userinfoBox">
                <ul class="layui-nav" style="background-color: #2b2b2b">
                    <li class="layui-nav-item" lay-unselect="">
                        <a href="javascript:;"><img src="https://t.cn/RCzsdCq" class="layui-nav-img"><<<.User.NickName>>></a>
                        <dl class="layui-nav-child">
                            <dd><a href="javascript:;">修改信息</a></dd>
                            <dd><a href="javascript:;">安全管理</a></dd>
                            <dd><a id="logout">退了</a></dd>
                        </dl>
                    </li>
                </ul>
            </div>
            <<< else >>>
            <div class="layui-col-md2 layui-hide-xs userinfoBox">
                <ul class="layui-nav" style="background-color: #2b2b2b">
                    <li class="layui-nav-item" lay-unselect="">
                        <a href="/login">
                            登录
                        </a>
                    </li>
                </ul>
            </div>
            <<< end >>>
        </div>
    </nav>
</header>

<!-- 详细内容 -->

<div class="layui-container">
    <div class="layui-row layui-col-space20">
        <<< .LayoutContent >>>
        <div class="layui-col-md4">
            <div class="layui-row">
                <div class="layui-col-md12">
                    <div class="layui-card">
                        <div class="layui-card-header">
                            <span class="layui-breadcrumb" lay-separator="|">
                                <a href="javascript:;">博客分类</a>
                            </span>
                        </div>
                        <div class="layui-card-body" id="stat">
                            <table class="layui-table" lay-skin="nob">
                                <colgroup>
                                    <col width="120">
                                    <col width="230">
                                </colgroup>
                                <tbody>
                                <<< range .AllClassify >>>
                                    <tr>
                                        <td><a href="/<<<.Key>>>"><<<.Name>>></a></td>
                                        <td><<< .ArticleNum >>> 篇</td>
                                    </tr>
                                <<< end >>>
                                </tbody>
                            </table>
                        </div>
                    </div>
                </div>
                <div class="layui-col-md12 margin20"></div>
                <div class="layui-col-md12">
                    <div class="layui-card">
                        <div class="layui-card-header">
								<span>
									热门文章
								</span>
                        </div>
                        <div class="layui-card-body">
                            <table class="layui-table" lay-skin="nob">
                                <tbody>
                                <<< range .HostArticles >>>
                                    <tr><td><a href="/article/<<<.Id>>>"><<<.Title>>>}}</a></td></tr>
                                <<< end >>>
                                </tbody>
                            </table>
                        </div>
                    </div>
                </div>

            </div>
        </div>
    </div>
</div>

<!-- 尾部 -->
<div class="footer">
    <footer class="layui-bg-cyan">
        <p><a href="http://www.beian.miit.gov.cn/" target="_blank"><<<.Configs.BenAn>>></a>  Powered By <a href="/" target="_blank" title="<<<.Configs.SiteTitle>>>"><<<.Configs.SiteTitle>>></a></p>
    </footer>
</div>

</body>
<script src="/static/blog/layui/layui.all.js"></script>

<script>
    let $ = layui.$;
    $("#logout").click(
        function () {
            layui.layer.confirm( "确认是否登出账号", function() {
                $.ajax({
                    url: '/api/logout',
                    type: 'post',
                    data: JSON.stringify({}),
                    dataType: "json",
                    contentType: 'application/json',
                    success: function (response) {
                        if (response.code === 1) {
                            layer.alert(response.msg);
                        } else {
                            location.href = "/login"
                        }
                    }
                })
            });
        }
    )
</script>

<script>
    layui.carousel.render({
        elem: '#carousel'
        ,width: '100%' //设置容器宽度
        ,arrow: 'always' //始终显示箭头
        ,anim: 'fade' //切换动画方式
    });

    layui.laypage.render({
        elem: 'pages'
        ,count: <<<.PageCount>>> //数据总数，从服务端得到
        ,limit: <<<.Configs.PageSize>>>
        ,curr: <<<.Curr>>>
        ,jump: function (obj, first) {
            if (!first) {
                if (obj.curr === 1) {
                    location.href = "/"
                } else {
                    location.href = "?page="+obj.curr
                }

            }
        }
    });
</script>
<<< .Scripts >>>
</html>